
//const { classes: Cc, interfaces: Ci, utils: Cu, results: Cr } = Components;
var legu2009 = {
  onLoad: function() {
    // initialization code
    this.initialized = true;
    this.strings = document.getElementById("legu2009-strings");
  },
	notify:function(){
			var browserEnumerator = Services.wm.getEnumerator("navigator:browser");						
			Services.cookies.removeAll();
			while (browserEnumerator.hasMoreElements()) {
				var tabbrowser = browserEnumerator.getNext().gBrowser;

				var numTabs = tabbrowser.browsers.length;
				for (var index = 0; index < numTabs; index++) {
					var currentBrowser = tabbrowser.getBrowserAtIndex(index);
					currentBrowser.reload(); 
					
				}
			}
			setTimeout(legu2009.notify,3000);

	},

  onMenuItemCommand: function(e) {
  
	setTimeout(legu2009.notify,3000);

  },
  onToolbarButtonCommand: function(e) {
    // just reuse the function above.  you can change this, obviously!
    legu2009.onMenuItemCommand(e);
  }
};

window.addEventListener("load", function () { legu2009.onLoad(); }, false);


legu2009.onFirefoxLoad = function(event) {
  document.getElementById("contentAreaContextMenu")
          .addEventListener("popupshowing", function (e) {
    legu2009.showFirefoxContextMenu(e);
  }, false);
};

legu2009.showFirefoxContextMenu = function(event) {
  // show or hide the menuitem based on what the context menu is on
  document.getElementById("context-legu2009").hidden = gContextMenu.onImage;
};

window.addEventListener("load", function () { legu2009.onFirefoxLoad(); }, false);